import sys
from pathlib import Path

# 添加项目根目录到 Python 路径
project_root = Path(__file__).parent.parent
sys.path.append(str(project_root))

from src.scheduler import run
from src.utils.logger import get_logger

logger = get_logger(__name__)

if __name__ == "__main__":
    try:
        logger.info("Starting scheduler")
        run()
    except KeyboardInterrupt:
        logger.info("Scheduler stopped by user")
    except Exception as e:
        logger.error(f"Scheduler failed: {e}")
        sys.exit(1) 